<?php
namespace App\Models;

use DateTimeInterface;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;

abstract class AbstractBaseModel extends Model
{
    use HasDateTimeFormatter;

    //
    const CREATED_AT = 'created_at';

    /**
     * The name of the "updated at" column.
     *
     * @var string|null
     */
    const UPDATED_AT = 'updated_at';



    // 移除批量赋值属性保护
    protected $guarded = [];
    public function __construct(array $attributes = [])
    {
        $this->perPage = request('limit',15);
        parent::__construct($attributes);
    }

    protected static function getUserInfo()
    {
        return auth('api')->user();
    }
}
